home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 Reader Awards / macformat-098.iso / MF Data / Behaviours / 00004_Script_Shrink < prev    next >
Encoding:
Text File  |  2000-11-01  |  1.0 KB  |  24 lines

  1. property viewDistance
  2. property growDistance
  3. property blendStrength
  4.  
  5. on exitFrame me
  6.   set shrinkH = (the locH of sprite (the spriteNum of me)) - (the mouseH)
  7.   set shrinkV = (the locV of sprite (the spriteNum of me)) - (the mouseV)
  8.  
  9.   set spriteSize = (-((shrinkH*shrinkH)/viewDistance)+growDistance)+(-((shrinkV*shrinkV)/viewDistance))
  10.   
  11.   set the width of sprite (the spriteNum of me) to spriteSize
  12.   set the height of sprite (the spriteNum of me) to the width of sprite (the spriteNum of me)
  13.   set the blend of sprite (the spriteNum of me) to (spriteSize*blendStrength/100)
  14. end
  15.  
  16. on getPropertyDescriptionList
  17.   set p_list = [¨
  18.                     #viewDistance: [ #default:225, #format:#integer, #comment:"View Distance",#range: [#min:100,#Max:1200]] ,¨
  19.                     #growDistance: [ #default:100, #format:#integer, #comment:"Grow Distance", #range:[#min:100,#Max:200]],¨
  20.                     #blendStrength: [ #default:100, #format:#integer, #comment:"Blend Strength", #range:[#min:0,#Max:100]] ¨
  21.                     ]
  22.   return p_list
  23. end
  24.